import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 猜数字小游戏
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-04-17  21:30
 */
public class Test1 {
    public static void main(String[] args) {
        Random random = new Random();
        int ranNum = random.nextInt(100);;
        Scanner scanner = new Scanner(System.in);

        while(true) {
            System.out.println("请输入猜的数字");
            int number = scanner.nextInt();
            if(number > ranNum) {
                System.out.println("猜大了");
            }else if (number < ranNum) {
                System.out.println("猜小了");
            }else {
                System.out.println("猜对了");
                break;
            }
        }
        scanner.close();
    }
}
